<?php
namespace Home\Controller;
use Think\Controller;

 
class NewsController extends Controller{
    public function index(){
        //首页
        $this->gsdt();
        $this->pnews();
        $this->menu();
        //加载网页的配置文件
        //数据库的操作
        //将数据读取到页面中
        
        #载入模板index.html
        $this->display('index');
    }
    public function lista(){
        //列表页
  
        echo '新闻栏目的列表页';
    }
    public function details(){
        //详细页
        echo '新闻栏目的详情页';
    }
    public function menu(){

    }   
    public function gsdt(){

    }
    public function pnews(){

    }

    #get传参
    #http://localhost/thinkphp/index.php/Home/News/addnews
    public function addnews(){#这么传参
        echo "<a href='http://localhost/thinkphp/index.php/Home/News/newssave?id=100'>控制器传参</a>";//控制器传参
        $this->display('a');//模板传参
    }
    
    public function newssave(){#这么接收参数的值
        $id = $_GET['id'];
        $cid = $_GET['cid'];
        echo $id;
        echo $cid;
    }
    public function newssave2(){#这么接收参数的值
        $name = $_GET['name'];
        
        
        echo $name;
    }
}